package com.xuxu.blog.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @className: MyRedissonConfig
 * @author: Maxuxu
 * @date: 2022/11/1 18:38
 * @description: Redisson的配置
 */
@Configuration
public class MyRedissonConfig {
    @Bean(destroyMethod = "shutdown")
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer().setAddress("redis://maxuxu.cf:6379");
        config.useSingleServer().setPassword("maxuxu2000");
        return Redisson.create(config);
    }
}
